//
//  YQJSBridge+CusBridge.m
//  CusWebView
//
//  Created by yeqiang on 2024/2/21.
//

#import "YQJSBridge+CusBridge.h"
#import "UIViewController+TopVC.h"
#import "YQJSBridgeWebViewController.h"

NSString *callBackId = @"nativeCallBack";

@implementation YQJSBridge (CusBridge)


- (void)backFirstPage:(NSDictionary *)params {
    UIViewController *vc = UIViewController.getCurrentUIVC;
    [vc dismissViewControllerAnimated:YES completion:nil];
}

- (void)pushPageBaidu:(NSDictionary *)params {
    NSString *urlStr = params[@"url"];
    YQJSBridgeWebViewController *vc = [[YQJSBridgeWebViewController alloc] initWithURL:[NSURL URLWithString:urlStr]];
    UIViewController *navi = UIViewController.getCurrentUIVC;
    [navi.navigationController pushViewController:vc animated:YES];
    self.jsCallBack(params[callBackId], @{@"key":@"123"});
}
- (void)nativeBack:(NSDictionary *)params {
    NSLog(@"%@", params.modelToJSONString);
}
@end
